package com.ztjava.common.service;

import java.util.List;

import com.ztjava.common.model.record.RecordInfo;
import com.ztjava.core.base.BaseService;
import com.ztjava.core.bean.sub.RecordBean;

public class RecordService extends BaseService{
	public void insertRecord(RecordBean recordBean){
		RecordInfo recordInfo = new RecordInfo();
		recordInfo.set("model", recordBean.getModel());
		recordInfo.set("object_id", recordBean.getObject_id());
		recordInfo.set("content", recordBean.getContent());
		recordInfo.set("create_user", recordBean.getCreate_user());
		recordInfo.save();
	}

	public List<RecordInfo> getInfoList(String model,Integer object_id){
		List<RecordInfo> infoList = RecordInfo.dao.find("select * from "+RecordInfo.tablename+" where model=? and object_id=? order by id asc",model,object_id);
		changeUser(infoList, new String[]{"create_user","name"});
		return infoList;
	}
}
